import Mock from 'mockjs'

export default [
  //我创建的项目
  // {
  //   url: '/projcet/createPaging',
  //   type: 'get',
  //   response: _ => {

  //     return {
  //       code : 20000,
  //       data : {
  //         pageSize : 10,
  //         currentPage : 1,
  //         totalPages : 3,
  //         totalCount : 30,
  //         list : Mock.mock({
  //           'list|10' : [{
  //             id: '@id',
  //             'projectNo|+100': 10000,
  //             'projectName|+1': "厂房监控项目@projectNo",
  //             "progress|0-100": 1,
  //             'taskTotalCnt|1-10': 1,
  //             "taskFinishedCnt|0-100": 1,
  //             createor: '@name',
  //             createTime : "@datetime",
  //             'particUser|3' : [{
  //               userId : "@id",
  //               'userName|2-5' : () => {
  //                 let arr = ['张三','李四','王麻子','王五','李狗蛋'];
  //                 return arr[Math.floor(Math.random()*5)]
  //               }
  //             }]
  //           }]
  //         }).list
  //       },
  //       msg : "请求成功"
  //     }
  //   }
  // },

  //关闭项目
  {
    url: '/projcet/closeProject',
    type: 'get',
    response: _ => {

      return {
        code : 20000,
        data : '',
        msg : "请求成功"
      }
    }
  },

  //添加项目
  {
    url: '/projcet/addProject',
    type: 'get',
    response: _ => {

      return {
        code : 20000,
        data : {
          id : "@id"
        },
        msg : "请求成功"
      }
    }
  },

  //获取项目详情
  {
    url: '/projcet/getDetail',
    type: 'get',
    response: _ => {

      return {
        code : 20000,
        data : Mock.mock({
          id : '@id',
          'projectNo|+100': 10000,
          'projectName|+1': "厂房监控项目@projectNo",
          "progress|0-100": 1,
          'taskTotalCnt|1-10': 1,
          "taskFinishedCnt|0-100": 1,
          milepost : 10100,
          createor: '@name',
          description : "这是一个备注信息",
          createTime : "@datetime",
          'particUser|1-5' : [{
            userId : "@id",
            'userName|2-5' : () => {
              let arr = ['张三','李四','王麻子','王五','李狗蛋'];
              return arr[Math.floor(Math.random()*5)]
            }
          }],
          "taskList|2-7" : [{
            "chargerId": "@id",
            "taskName": "任务一",
            "chargeName|1": ['张三','李四','王麻子','王五','李狗蛋'],
            "taskNo": "@id",
            "markName": "里程碑",
            "phaseName": "阶段一",
            "priority": 0,
            "description": "",
            "remark": "",
            "operateId": 0,
            "operateStatus|1-3": 0,
            "planEndTime": "@datetime",
          }],
          "milepostList|2-10" : [{
            "no|+1" : 1,
            'milepostName' : '第@no阶段',
            'list|5-15' : [{
              "no|+1" : 1,
              taskName : "任务名称@no",
              'creator|1' : ['张三','李四','王麻子','王五','李狗蛋'],
              creatDate : "@date",
              "chargeName|2-5": ['张三','李四','王麻子','王五','李狗蛋'],
              yujitime : "@date",
              'completionTime' : "@date",
              'completionPeople|1' : ['张三','李四','王麻子','王五','李狗蛋'],
              'state|1' : [0,1,2],
              bill : {
                creatTime : "@date",
                'list|1-3' : [{
                  "no|+1" : 1,
                  billName : "销售订单@no"
                }]
              },
              'files|0-3' : [{
                "no|+1" : 1,
                "fileName|1-5" : "这是一个附件@no"
              }]
            }]
          }]
        }),
        msg : "请求成功"
      }
    }
  }
]